home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1994-07-07 | 2.3 KB | 89 lines | [ TEXT/ALFA]
proc rebuildTclIndices {} { set dir [pwd] cd message "Building SystemCode index…" auto_mkindex :Tcl:SystemCode *.tcl message "Building UserCode index…" auto_mkindex :Tcl:UserCode *.tcl message "" cd $dir } proc tclMenuProc {menu item} { global tclColoring eval $item } #=========================================================================== # Debug a Tcl procedure. #=========================================================================== # Alpha TCL programming mode proc traceTclProc {} { global tclMenu if {[llength [traceFunc status]]>2} { traceFunc off markMenuItem $tclMenu traceTclProc off dumpTraces return } set func [listpick -p {Func Name:} [lsort [info procs]]] if {![string length $func]} return traceFunc on $func "" catch {markMenuItem $tclMenu traceTclProc on} } proc setTclMode {} { global tclMenu changeMode "Tcl" uplevel #0 { set elecLBrace 0 set elecRBrace 0 set electricSemi 0 set wordWrap 0 set funcExpr {^proc *([+-a-zA-Z0-9]+)} set wordBreakPreface {[^a-zA-Z0-9_\$]} set wordBreak {(\$)?[a-zA-Z0-9_]+} set funcPar 1 set sortedIsDefault 1 set prefixString "# " } insertMenu $tclMenu } #================================================================================ proc tclMarkFile {} { global mpos set end [maxPos] set pos 0 set l {} while {![catch {search -f 1 -r 1 -m 0 -i 0 {^proc} $pos} res]} { set start [lindex $res 0] set end [nextLineStart $start] set text [lindex [getText $start $end] 1] set pos $end set inds($text) [lineStart [expr $start - 1]] } if {[info exists inds]} { foreach f [lsort [array names inds]] { set next [nextLineStart $inds($f)] setNamedMark $f $inds($f) $next $next } } } #================================================================================ # Colorize tcl code. #================================================================================ set tclKeywords {append array break case catch cd close concat continue elseif else eof error eval exec exit expr file flush foreach format for gets global glob history if incr info join lappend library lindex linsert list llength lrange lreplace lsearch lsort open pid proc puts pwd read regexp regsub rename return scancontext scan seek set source split string switch tell time trace unknown unset uplevel upvar while} regModeKeywords -e {#} -c red -k blue Tcl $tclKeywords